package de.stefanocke.roo.wicket.templates

import de.stefanocke.roo.wicket.Stereotypes

class ComponentFactoryTemplate extends JavaHtmlTemplate{
	
	override String javaClassNameWhenNew(){
		"ComponentFactory"
	}
	
	override String stereotype(){
		Stereotypes::COMPONENT_FACTORY
	}
	
	override subPackageToUseWhenNew(){
		"common"
	}
	
	override buildJavaContents(){
		import_("java.io.Serializable")
		import_("org.apache.wicket.Component")
		import_("org.apache.wicket.model.IModel");
		'''
		/**
		 * A factory for components. 
		 */
		«stereotypeAnnotation» 
		public interface «simpleTypeName»<T> extends Serializable{
			Component createComponent(String id, IModel<T> model);
		}
		'''
	}	
}